Skip to content

Upgrade the 3D packing UI and extend releases with native installers and physics-aware packing heuristics#31

Merged
JosunLP merged 18 commits into
mainfrom
copilot/enhance-project-visualization
Mar 16, 2026
Merged

Upgrade the 3D packing UI and extend releases with native installers and physics-aware packing heuristics#31
JosunLP merged 18 commits into
mainfrom
copilot/enhance-project-visualization

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

This PR advances the existing product surface instead of rewriting it: it improves the web UI, expands the release/install experience, and strengthens the packing logic with more physics-aware heuristics. The result is a frontend that is easier to operate, a distribution flow that is easier to install, and an optimizer that evaluates placements more robustly.

  • Packing workflow UX

    • Replaced blocking browser dialogs with in-app toast notifications
    • Added a central Packing Status panel showing:
      • mode / phase
      • container count
      • placed vs. remaining objects
      • config readiness
      • progress bar
    • Added a dedicated Unplaced Objects panel with dimensions, weight, and rejection reason
  • Visualization clarity

    • Added a visual legend for frame / placed / active / unplaced states
    • Highlighted the current object during live placement and step animation
    • Kept the existing scene/camera flow intact while improving state readability
  • Configuration improvements

    • Persisted UI configuration in localStorage
    • Added inline configuration validation summary in the modal
    • Prevented runs from starting when the current config has unresolved fit/weight issues
    • Kept the existing configuration model and request shape unchanged
  • Accessibility and interaction

    • Added keyboard shortcuts for the main workflow:
      • B batch run
      • L live run
      • C open configuration
      • ← / → switch containers
      • Space toggle animation
    • Improved modal focus behavior and keyboard handling
    • Added better live-region behavior for error/status announcements
    • Added reduced-motion-aware animation timing
    • Upgraded the configuration modal to a proper dialog with initial focus and focus trapping for keyboard/screen-reader use
  • Frontend robustness

    • Switched frontend API calls to same-origin /pack and /pack_stream
    • Documented the same-origin assumption in the README
    • Escaped user-controlled text rendered back into the UI to avoid introducing HTML injection issues through persisted config / diagnostics surfaces
    • Prevented overlapping live runs by aborting superseded /pack_stream requests before starting a new one
    • Hardened SSE parsing to ignore keep-alive comment frames and only parse concatenated data: payloads

Example of the frontend API change:

const response = await fetch('/pack', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(payload),
});
  • Release, deploy, and installation

    • Extended the release workflow to continue publishing archive bundles while also producing native installers:
      • Linux: .deb
      • macOS: .pkg
      • Windows: .msix
    • Added bundled install/uninstall scripts to release archives
    • Upgraded the Unix and Windows installer scripts so they work both:
      • from an extracted release bundle
      • as a one-command installer that downloads the latest matching release
    • Added dedicated uninstall flows for Unix and Windows
    • Documented native installer usage, one-command install/uninstall, and the Windows certificate trust requirement in the README
    • Preserved compatibility with the existing archive-based auto-update path
    • Made snapshot/native package metadata unique for non-semver workflow runs so ad-hoc packages remain distinguishable and upgrade-safe
    • Added clearer Windows install/uninstall permission handling with explicit guidance when elevated access or a user-writable destination is required
  • Packing/optimizer improvements

    • Reworked object ordering to consider additional physics-relevant factors beyond simple weight/volume ordering:
      • load on base area
      • density
      • slenderness
    • Expanded placement scoring with static stability heuristics, including:
      • support coverage
      • support centroid offset
      • support contact count
      • instability penalty
    • Added optimizer test coverage for the new ordering and stability behavior
  • Files

    • web/index.html
    • web/script.js
    • README.md
    • .github/workflows/release.yml
    • scripts/install-unix.sh
    • scripts/uninstall-unix.sh
    • scripts/install-windows.ps1
    • scripts/uninstall-windows.ps1
    • src/optimizer.rs
  • Screenshot

> [!WARNING]
> This PR now spans beyond the original UI-only scope. It includes frontend UX changes, release/distribution changes, and optimizer heuristic changes in one branch.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@github-actions github-actions Bot added documentation Improvements or additions to documentation web labels Mar 11, 2026
Copilot AI changed the title [WIP] Enhance project visualization and add new features Upgrade the 3D packing UI with persistent config, live status feedback, and clearer visualization states Mar 11, 2026
@JosunLP
Copy link
Copy Markdown
Owner

JosunLP commented Mar 11, 2026

Überarbeite ebenfalls den Release Deploy und die Installation. Es sollte zukünftig sowohl single command Installation und Deinstallation möglich sein, als auch die Installation über native installer für Windows (z.B. msix), MacOs und Linux (z.B. deb) möglich sein. Des weiteren soll die Berechnungsgrundlage für die Sortierung stark verbessert werden und zukünftig auch Physikalische Simulation mit einbeziehen, zusätzlich zu den anderen Faktoren!

@copilot

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 11, 2026

Überarbeite ebenfalls den Release Deploy und die Installation. Es sollte zukünftig sowohl single command Installation und Deinstallation möglich sein, als auch die Installation über native install...

Das sind drei größere Themenblöcke, die ich nicht sauber und risikoarm in dieser UI-PR vermischen sollte: (1) Release/Deploy + One-command Install/Uninstall, (2) native Installer pro Plattform, (3) deutlich erweiterte Optimierung bis hin zu physikalischer Simulation. Für die aktuelle PR habe ich den UI-Teil bereits in 2a975d4 abgeschlossen. Bitte priorisiere, womit ich als Nächstes starten soll: zuerst die Release-/Installer-Pipeline oder zuerst die Optimierungs-/Physik-Erweiterung. Für die Installer-Seite wäre zusätzlich hilfreich, ob du für Windows konkret MSIX priorisierst und für Linux zuerst .deb oder zusätzlich z. B. AppImage/RPM willst.

@JosunLP
Copy link
Copy Markdown
Owner

JosunLP commented Mar 11, 2026

Überarbeite ebenfalls den Release Deploy und die Installation. Es sollte zukünftig sowohl single command Installation und Deinstallation möglich sein, als auch die Installation über native install...

Das sind drei größere Themenblöcke, die ich nicht sauber und risikoarm in dieser UI-PR vermischen sollte: (1) Release/Deploy + One-command Install/Uninstall, (2) native Installer pro Plattform, (3) deutlich erweiterte Optimierung bis hin zu physikalischer Simulation. Für die aktuelle PR habe ich den UI-Teil bereits in 2a975d4 abgeschlossen. Bitte priorisiere, womit ich als Nächstes starten soll: zuerst die Release-/Installer-Pipeline oder zuerst die Optimierungs-/Physik-Erweiterung. Für die Installer-Seite wäre zusätzlich hilfreich, ob du für Windows konkret MSIX priorisierst und für Linux zuerst .deb oder zusätzlich z. B. AppImage/RPM willst.

Setze ALLE diese Punkte selbstständig um! @copilot

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 11, 2026

Überarbeite ebenfalls den Release Deploy und die Installation. Es sollte zukünftig sowohl single command Installation und Deinstallation möglich sein, als auch die Installation über native ins...

Erledigt in 65f85f2. Ich habe die Release-/Installationsstrecke erweitert (One-command Install/Uninstall für Unix/Windows, zusätzliche native Release-Artefakte .deb, .pkg, .msix inkl. README-Doku) und zugleich die Packlogik mit physiknäherer Priorisierung sowie statischer Stabilitätsbewertung ausgebaut. Die Archiv-basierten Auto-Updates bleiben dabei kompatibel.

Copilot AI changed the title Upgrade the 3D packing UI with persistent config, live status feedback, and clearer visualization states Upgrade the 3D packing UI and extend releases with native installers and physics-aware packing heuristics Mar 11, 2026
@JosunLP JosunLP marked this pull request as ready for review March 12, 2026 11:16
Copilot AI review requested due to automatic review settings March 12, 2026 11:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands sort-it-now across three surfaces: the web UI (status/toasts/persistence/accessibility), the release + install experience (native installers and uninstall flows), and the optimizer (more physics-aware ordering and placement scoring).

Changes:

  • Web UI: adds a packing status panel, unplaced-object panel, toast notifications, keyboard shortcuts, reduced-motion timing, same-origin API calls, and localStorage-backed config persistence.
  • Release/install: extends the GitHub release workflow to produce .deb / .pkg / .msix alongside archives, and adds install/uninstall scripts that can run from bundles or download latest releases.
  • Optimizer: introduces physics-aware object ordering and static-stability heuristics in placement scoring, with added tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
web/script.js UI state management (status/toasts/unplaced panel), config persistence/validation, keyboard shortcuts, same-origin fetches, active-object highlighting.
web/index.html Adds status/unplaced/toast panels, legend/help updates, modal validation summary, responsive + reduced-motion CSS.
src/optimizer.rs Physics-aware ordering, new stability metrics in scoring, and new tests validating ordering/stability behavior.
scripts/install-unix.sh Supports local-bundle install or one-command GitHub release download + checksum verification.
scripts/uninstall-unix.sh Adds uninstall flow for archive/script-based installs.
scripts/install-windows.ps1 Supports local-bundle install or downloading latest/tagged GitHub release + checksum verification.
scripts/uninstall-windows.ps1 Adds uninstall flow and PATH cleanup for Windows script installs.
README.md Documents new UI panels/shortcuts, same-origin API assumption, and new installation/uninstallation + native installer flows.
.github/workflows/release.yml Adds .deb/.pkg/.msix packaging and includes uninstall scripts in release bundles.

Comment thread web/script.js Outdated
Comment thread README.md Outdated
Comment thread src/optimizer.rs
Comment thread src/optimizer.rs Outdated
Comment thread web/script.js Outdated
@JosunLP
Copy link
Copy Markdown
Owner

JosunLP commented Mar 12, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Erledigt in 59004ea. Ich habe den Release-Upload so umgestellt, dass Archive und native Installer pro Plattform in separaten, erwarteten Schritten hochgeladen werden statt fehlende Dateien global zu ignorieren; außerdem läuft der Windows-Uninstaller jetzt auch dann weiter mit PATH-/Ordner-Bereinigung, wenn sort_it_now.exe bereits fehlt. Screenshot unverändert: https://github.com/user-attachments/assets/d9fc5ac5-c1c8-42e7-993a-795fa2bfca21

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread web/script.js
Comment thread web/index.html
Comment thread scripts/install-unix.sh Outdated
@JosunLP
Copy link
Copy Markdown
Owner

JosunLP commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Erledigt in 8c77e3b. Ich habe den Live-SSE-Reader um Decoder-Flush plus Verarbeitung des verbleibenden Buffers ergänzt, den Modal-Close-Button per gezieltem CSS-Reset von den globalen Button-Stilen entkoppelt und das Temp-Verzeichnis im Unix-Installer so an eine skriptweite Variable gebunden, dass der EXIT-Trap es nach dem Funktions-Return zuverlässig entfernt. Screenshot: https://github.com/user-attachments/assets/eef2858e-4eb3-438a-b683-d986ed9bb2f2

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/optimizer.rs
@JosunLP
Copy link
Copy Markdown
Owner

JosunLP commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Erledigt in 40726e6. Ich habe PackingConfig am Start des Packing-Laufs zentral gehärtet, sodass nicht-finite oder außerhalb des gültigen Bereichs liegende numerische Werte auf sichere Defaults zurückfallen und dadurch Support-/Balance-Prüfungen nicht mehr stillschweigend ausgehebelt werden; dazu kommen Regressionstests für die Sanitization und den NaN-Support-Ratio-Fall. Screenshot unverändert: https://github.com/user-attachments/assets/eef2858e-4eb3-438a-b683-d986ed9bb2f2

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
@JosunLP
Copy link
Copy Markdown
Owner

JosunLP commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot apply changes based on the comments in this thread

Erledigt in 59c0482. Ich habe das Debian-Paket im Release-Workflow auf paketverwaltete Pfade unter /usr umgestellt und das redundante prerm entfernt, damit dpkg die installierten Dateien selbst verwaltet. Screenshot unverändert: https://github.com/user-attachments/assets/eef2858e-4eb3-438a-b683-d986ed9bb2f2

@JosunLP JosunLP requested a review from Copilot March 16, 2026 10:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config documentation Improvements or additions to documentation rust scripts web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants